<?php
class Administrator_Controller_Form extends BaseForm{

	public $labelMap = array(
		Controller::ID => 'ID',
		Controller::NAME => 'Tên',
		Controller::DISPLAY => 'Tên hiễn thị',
		Controller::MODULE => 'Module'
	);
	/**
	 * 
	 * array[0]=>type <br>
	 * array[1]=>row span<br>
	 * array[2]=>data<br>
	 * array[3]=>is disable <br>
	 * array[4]=>PlaceHolder<br>
	 * array[5]=>validate<br>
	 * @var array
	 */
	public $leftcols = array(
		Controller::NAME => array(BaseForm::TYPE_TEXTBOX,'1','data',false,"Nhập tên controller",array(BaseForm::VAL_REQUIRE))
	);
	
	public $rightcols = array(
		Controller::DISPLAY => array(BaseForm::TYPE_TEXTBOX,'1','data',false,"Nhập tên hiễn thị",array(BaseForm::VAL_REQUIRE)),
	);

	public function init(){
		$db = DBHelper::getInstance();
		$sql = 'select id as '.BaseForm::COMBO_VAL.',name as '.BaseForm::COMBO_NAME.' from module';
		$result = $db->fetchAll($sql);
		if(isset($result)){
			$this->rightcols[Controller::MODULE] = array(BaseForm::TYPE_COMBOBOX,'1',$result,false);
		}
	}
}